package com.chenyao.curtain.topic.send;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SendTopic {
	
	@Autowired
	AmqpTemplate amqpTemplate;
	// 发送者A
	public void sendA(String message) {
		amqpTemplate.convertAndSend("topicExchange", "topic.a", message);
	}
	
	
	// 发送者B
	public void sendB(String message) {
		amqpTemplate.convertAndSend("topicExchange", "topic.b", message);
	}
	
	
	// 发送者Any
	public void sendAny(String message) {
		amqpTemplate.convertAndSend("topicExchange", "topic.any", message);
	}

}
